package com.etc.test;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.etc.entity.Patientlogin;
import com.etc.service.PatientLoginService;

/**
 * 
 * 病人登录测试类
 * @author 
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:applicationContext.xml", "classpath:mybatis-config.xml" })
public class PatientLoginTestJUnit {
	@Autowired
	private PatientLoginService patientLoginService;
	
	/*@Test
	public void insert() {
         Patientlogin pl = new Patientlogin();
         pl.setPatientloginid(4);
         pl.setPatientid(4);
         pl.setUserpwd("444");
         pl.setBalance(444);
	     int num=patientLoginService.insertPatientLogin(pl);
         System.out.println("num:"+num);
	}*/
	/*@Test
     public void deletebykey() {
    	 int num=patientLoginService.delPatientLoginBykey(4);
    	 System.out.println("num:"+num);
     }*/
	/**
	 * 根据账号密码查询所有病人登录信息
	 */
/*	@Test
	public void getLoginById() {
		Patientlogin patientlogin=patientLoginService.getPatientLoginbyId("222","222");
		System.out.println(patientlogin);
	}
	@Test
	public void addUser() {
		Patientlogin pl = new Patientlogin();
	    pl.setPatientloginid("555");
	    pl.setUserpwd("555");
		boolean flag=patientLoginService.addPatient(pl);
		System.out.println(flag);
	}*/
	@Test
	public void selectById() {
		Patientlogin p=patientLoginService.selPatientById("222");
		System.out.println(p);
		
	}
	@Test
	public void addpatient() {
		Patientlogin pl = new Patientlogin();
		pl.setPatientloginid("666");
		pl.setUserpwd("666");
		boolean flag=patientLoginService.addPatient(pl);
		System.out.println(flag);
	}
	}
